<template>
	<uni-popup ref="infoPop" type="center">
		<view v-if="detail" class="info-page">
			<view class="content flex flex-col justify-center item-center">
				<image :src="detail.avatar" mode="" class="detail-image"></image>
				<view class="detail-name">{{detail.nickName}}</view>
				<view class="detail-dec my-16">
					<view class="detail-dec-item">
						<text>姓名：{{ detail.realName }}</text>
					</view>
					<view class="detail-dec-item flex justify-between">
						<text>微信号：{{ detail.wechat }}</text>
						<image class="size-46" src="@/pagesD/static/role/icon-copy.svg" @click="copy(detail.wechat)"></image>
					</view>
					<view class="detail-dec-item">
						<text>手机号：{{ detail.mobile }}</text>
					</view>
				</view>
				<view class="detail-dec second">
					<!-- <view class="detail-dec-item flex justify-between">
						<text>本月预估佣金：</text>
						<text class="detail-count">¥0.09</text>
					</view> -->
					<view class="detail-dec-item flex justify-between">
						<text>累计佣金：</text>
						<text class="detail-count">¥{{ detail.totalSettleCommission }}</text>
					</view>
					<view class="detail-dec-item flex justify-between">
						<text>团队人数：</text>
						<text class="detail-count">{{ detail.inviteCount }}</text>
					</view>
					<view class="detail-dec-item flex justify-between">
						<text>最近登录</text>
						<text class="detail-count">{{ detail.lastLoginTime }}</text>
					</view>
				</view>
			</view>
			
		</view>
		<view class="close-top flex justify-center">
			<image src="@/static/svg/icon-close.svg" mode="widthFix" class="icon-close" style="width: 60rpx;" @click="showPop(false)"></image>
		</view>
	</uni-popup>	
</template>

<script setup>
	import {ref} from 'vue'
	const props = defineProps({
		detail: {
			type: Object
		}
	})
	const infoPop = ref()
	const copy = (str) => {
		uni.setClipboardData({
			data: str,
			success: function () {
				uni.showToast({
					icon:'none',
					title:'复制成功'
				})
			}
		});
	
	}
	const showPop = (value) => {
		if (value) {
			infoPop.value && infoPop.value.open('center')
		} else {
			infoPop.value && infoPop.value.close()
		}
	}
	defineExpose({
		showPop
	})
</script>

<style lang="scss" scoped>
	.close-top{
		width: 100%;
		margin-top: 30px;
	}
	.content{
		position: relative;
	}
	.info-page{
		width: 700rpx;
		border-radius: 8px;
		background-color: #ffffff;
		position: relative;
	}
	.detail-image{
		width: 74px;
		height: 74px;
		border-radius: 50%;
		margin-top: -38px;
		margin-bottom: 8px;
	}
	.detail-name{
		font-family: PingFang SC;
		font-size: 16px;
		font-weight: 600;
		color: #333333;
		text-align: center;
	}
	.detail-dec{
		width: 542rpx;
		padding: 12px 16px;
		border-radius: 8px;
		background: #F8F8F8;
		&.second{
			padding: 0 16px 24px;
			background: #fff;
			.detail-dec-item{
				margin-bottom: 12px;
			}
		}
		.detail-dec-item{
			align-items: center;
			font-family: PingFang SC;
			font-size: 14px;
			color: #333333;
			text-align: left;
		}
		.detail-count{
			color: rgba(51, 51, 51, 1);
		}
	}
</style>